﻿using System;
using Character;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

// Token: 0x02000207 RID: 519
public class HMaleShowChangeUI : MonoBehaviour
{
	// Token: 0x06000E2C RID: 3628 RVA: 0x00058A90 File Offset: 0x00056C90
	private void Awake()
	{
		this.clothing.ActionAddListener(delegate(bool flag)
		{
			if (flag)
			{
				this.OnChange_Clothing();
			}
		});
		this.bareFeet.onValueChanged.AddListener(new UnityAction<bool>(this.OnChange_BareFeet));
		this.nude.ActionAddListener(delegate(bool flag)
		{
			if (flag)
			{
				this.OnChange_Nude();
			}
		});
		this.oneColor.ActionAddListener(delegate(bool flag)
		{
			if (flag)
			{
				this.OnChange_Color();
			}
		});
		this.tin.ActionAddListener(delegate(bool flag)
		{
			if (flag)
			{
				this.OnChange_Tin();
			}
		});
		this.hide.ActionAddListener(delegate(bool flag)
		{
			if (flag)
			{
				this.OnChange_Hide();
			}
		});
	}

	// Token: 0x06000E2D RID: 3629 RVA: 0x00058B2C File Offset: 0x00056D2C
	public void Setup(H_Scene h_scene)
	{
		this.h_scene = h_scene;
	}

	// Token: 0x06000E2E RID: 3630 RVA: 0x00058B38 File Offset: 0x00056D38
	public void SetMale(Male male)
	{
		this.male = male;
		if (male != null)
		{
			this.name.text = Male.MaleName(male.MaleID);
		}
	}

	// Token: 0x06000E2F RID: 3631 RVA: 0x00058B64 File Offset: 0x00056D64
	public void UpdateToggles()
	{
		this.invoke = false;
		if (this.male != null)
		{
			this.clothing.ChangeValue(this.male.MaleShow == MALE_SHOW.CLOTHING, false);
			this.nude.ChangeValue(this.male.MaleShow == MALE_SHOW.NUDE, false);
			this.oneColor.ChangeValue(this.male.MaleShow == MALE_SHOW.ONECOLOR, false);
			this.tin.ChangeValue(this.male.MaleShow == MALE_SHOW.TIN, false);
			this.hide.ChangeValue(this.male.MaleShow == MALE_SHOW.HIDE, false);
			this.bareFeet.gameObject.SetActive(this.male.MaleShow == MALE_SHOW.CLOTHING);
			this.bareFeet.isOn = this.male.WearShoes;
		}
		this.invoke = true;
	}

	// Token: 0x06000E30 RID: 3632 RVA: 0x00058C48 File Offset: 0x00056E48
	public Male GetMale()
	{
		return this.male;
	}

	// Token: 0x06000E31 RID: 3633 RVA: 0x00058C50 File Offset: 0x00056E50
	private void Record()
	{
		if (this.male != null)
		{
			GlobalData.maleShows[(int)this.male.MaleID] = this.male.MaleShow;
		}
	}

	// Token: 0x06000E32 RID: 3634 RVA: 0x00058C80 File Offset: 0x00056E80
	private void OnChange_Clothing()
	{
		if (!this.invoke)
		{
			return;
		}
		SystemSE.Play(SystemSE.SE.CHOICE);
		if (this.male != null)
		{
			this.male.ChangeMaleShow(MALE_SHOW.CLOTHING);
		}
		this.Record();
		this.bareFeet.gameObject.SetActive(true);
	}

	// Token: 0x06000E33 RID: 3635 RVA: 0x00058CD4 File Offset: 0x00056ED4
	private void OnChange_Nude()
	{
		if (!this.invoke)
		{
			return;
		}
		SystemSE.Play(SystemSE.SE.CHOICE);
		if (this.male != null)
		{
			this.male.ChangeMaleShow(MALE_SHOW.NUDE);
		}
		this.Record();
		this.bareFeet.gameObject.SetActive(false);
	}

	// Token: 0x06000E34 RID: 3636 RVA: 0x00058D28 File Offset: 0x00056F28
	private void OnChange_Color()
	{
		if (!this.invoke)
		{
			return;
		}
		SystemSE.Play(SystemSE.SE.CHOICE);
		if (this.male != null)
		{
			this.male.ChangeMaleShow(MALE_SHOW.ONECOLOR);
		}
		this.Record();
		this.bareFeet.gameObject.SetActive(false);
	}

	// Token: 0x06000E35 RID: 3637 RVA: 0x00058D7C File Offset: 0x00056F7C
	private void OnChange_Tin()
	{
		if (!this.invoke)
		{
			return;
		}
		SystemSE.Play(SystemSE.SE.CHOICE);
		if (this.male != null)
		{
			this.male.ChangeMaleShow(MALE_SHOW.TIN);
		}
		this.Record();
		this.bareFeet.gameObject.SetActive(false);
	}

	// Token: 0x06000E36 RID: 3638 RVA: 0x00058DD0 File Offset: 0x00056FD0
	private void OnChange_Hide()
	{
		if (!this.invoke)
		{
			return;
		}
		SystemSE.Play(SystemSE.SE.CHOICE);
		if (this.male != null)
		{
			this.male.ChangeMaleShow(MALE_SHOW.HIDE);
		}
		this.Record();
		this.bareFeet.gameObject.SetActive(false);
	}

	// Token: 0x06000E37 RID: 3639 RVA: 0x00058E24 File Offset: 0x00057024
	private void OnChange_BareFeet(bool flag)
	{
		if (!this.invoke)
		{
			return;
		}
		SystemSE.Play(SystemSE.SE.CHOICE);
		if (this.male != null)
		{
			this.male.SetWearShoes(flag);
		}
	}

	// Token: 0x04000EB1 RID: 3761
	[SerializeField]
	private new Text name;

	// Token: 0x04000EB2 RID: 3762
	[SerializeField]
	private ToggleButton clothing;

	// Token: 0x04000EB3 RID: 3763
	[SerializeField]
	private ToggleButton nude;

	// Token: 0x04000EB4 RID: 3764
	[SerializeField]
	private ToggleButton oneColor;

	// Token: 0x04000EB5 RID: 3765
	[SerializeField]
	private ToggleButton tin;

	// Token: 0x04000EB6 RID: 3766
	[SerializeField]
	private ToggleButton hide;

	// Token: 0x04000EB7 RID: 3767
	[SerializeField]
	private Toggle bareFeet;

	// Token: 0x04000EB8 RID: 3768
	private bool invoke = true;

	// Token: 0x04000EB9 RID: 3769
	private H_Scene h_scene;

	// Token: 0x04000EBA RID: 3770
	private Male male;
}
